/**
 * UserSvnProjectAction.java
 *
 * Copyright (c) 2010 Prj.Manager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Prj.Manager .
 **/
package ro.prjmanager.web.actions;

import ro.prjmanager.core.annotations.*;
import ro.prjmanager.model.UserSvnProject;
import ro.prjmanager.web.annotation.NomenclatorTarget;
import ro.prjmanager.web.annotation.Service;

@Service(target = "usersvnprojectService")
@NomenclatorTarget(addTarget = "add",deleteTarget = "del",editTarget = "edit",
        resource = "/pages/nomenclators/usersvnproject/usersvnproject.jsp",
        onFaildReturn = "/pages/nomenclators/usersvnproject/usersvnproject.jsp")
@List(serviceName = "usersvnprojectService",
        caption = "UserSvnProject List",
        editUrl = "%context_path%/actions/UserSvnProject.action",
        id = "1", height = 200, rowNum = 10,
        url = "%context_path%/usersvnproject.lst")
public class UserSvnProjectAction extends GenericAction<UserSvnProject> {

    @Id
    private Long idL;

    @Column(name = "fkUser", caption = "FK_USER", index = "fkUser", width = 250, editOptions = @EditOptions(pos = 2 ,required = true , prefix = "(*)" ,edittype = "select",size = 1 ))
    @SelectOption(id="fkUser",serviceName = "usersService",nameOption = "userName")
    private java.lang.Integer fkUser;

    @Column(name = "fkProject", caption = "FK_PROJECT", index = "fkProject", width = 250, editOptions = @EditOptions(pos = 3 ,required = true , prefix = "(*)" ,edittype = "select",size = 1 ))
    @SelectOption(id="fkProject",serviceName = "projectsService")
    private java.lang.Integer fkProject;

    @Column(name = "fkSvn", caption = "FK_SVN", index = "fkSvn", width = 250, editOptions = @EditOptions(pos = 4 ,required = true , prefix = "(*)" ,edittype = "select",size = 1 ))
    @SelectOption(id="fkSvn",serviceName = "svnService")
    private java.lang.Integer fkSvn;

    public Long getIdL() {
        if(getId()!=null&&!getId().isEmpty()&&!getId().equals("_empty"))
          idL=Long.valueOf(getId());
        return idL;
    }

    public void setIdL(Long idL) {
        this.idL = idL;
        if(idL!=null)
            this.setId(String.valueOf(idL));
    }

    /**
     * This method gets the fkUser attribute
     * @return - an  java.lang.Integer  object
     **/
    public  java.lang.Integer  getFkUser(){
        return this.fkUser;
    }

    /**
     * The setter for the fkUser attribute
     * @param fkUser -  an  java.lang.Integer  object
     **/
    public void setFkUser( java.lang.Integer  fkUser){
        this.fkUser=fkUser;
    }
    /**
     * This method gets the fkProject attribute
     * @return - an  java.lang.Integer  object
     **/
    public  java.lang.Integer  getFkProject(){
        return this.fkProject;
    }

    /**
     * The setter for the fkProject attribute
     * @param fkProject -  an  java.lang.Integer  object
     **/
    public void setFkProject( java.lang.Integer  fkProject){
        this.fkProject=fkProject;
    }
    /**
     * This method gets the fkSvn attribute
     * @return - an  java.lang.Integer  object
     **/
    public  java.lang.Integer  getFkSvn(){
        return this.fkSvn;
    }

    /**
     * The setter for the fkSvn attribute
     * @param fkSvn -  an  java.lang.Integer  object
     **/
    public void setFkSvn( java.lang.Integer  fkSvn){
        this.fkSvn=fkSvn;
    }


    public void add() {
        UserSvnProject adderObj=getModel();
        getService().create(adderObj);

    }
    public void edit() {
         UserSvnProject editObj=getModel();
        getService().update(editObj);
    }

}
